package com.neusoft.neuiotms.dcam.fixed.service;

import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.List;

import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.neusoft.bizcore.auth.common.bean.UserBean;
import com.neusoft.bizcore.web.support.Searchable;
import com.neusoft.neuiotms.dcam.common.dto.DcamInstitutionsDTO;
import com.neusoft.neuiotms.dcam.fixed.dto.AssetAttachmentDTO;
import com.neusoft.neuiotms.dcam.fixed.dto.AssetDTO;
import com.neusoft.neuiotms.dcam.fixed.model.Asset;
import com.neusoft.neuiotms.dcam.fixed.model.AssetType;
import com.neusoft.neuiotms.dcam.fixed.model.Product;

public interface AssetService {

    List<AssetDTO> findAll(Searchable searchable);

    Long count(Searchable searchable);

    Page<AssetDTO> search(Pageable pageable, Searchable searchable);

    AssetDTO details(final Long id);

    AssetDTO create(final AssetDTO dto);

    AssetDTO update(final Long id, final AssetDTO dto);

    void delete(final Long id);

    void deleteBatch(final Long[] ids);

    void upload(InputStream fileStream, String username);

    Workbook export(final Searchable searchable, final Pageable pageable, UserBean userBean);

    Workbook exportReport(final Searchable searchable);

    Workbook template(UserBean userBean);

    List<Asset> findByProduct(Product product);

    List<Asset> findByType(AssetType type);

    List<AssetDTO> indexAll(Searchable searchable, UserBean userBean);

    Page<AssetDTO> search(Pageable pageable, Searchable searchable, UserBean userBean) throws FileNotFoundException;

    void batchHandles(Long[] ids);

    String qrcodeFile(Long[] ids) throws FileNotFoundException;

    List<DcamInstitutionsDTO> searchInstitution(UserBean userBean);

    Workbook exportMaintenanceReport(final Searchable searchable);

    boolean updateAssetRunningStatus(boolean status, Long[] ids);

    void lifeCycle(Long[] ids, String status);

    void addAttachment(AssetAttachmentDTO attachment);
}
